Integrand size = 16, antiderivative size = 138 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {24 b^2 \cos (c+d x)}{d^5}+\frac {4 a b \cos (c+d x)}{d^3}-\frac {a^2 \cos (c+d x)}{d}+\frac {12 b^2 x^2 \cos (c+d x)}{d^3}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {b^2 x^4 \cos (c+d x)}{d}-\frac {24 b^2 x \sin (c+d x)}{d^4}+\frac {4 a b x \sin (c+d x)}{d^2}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3410, 2718, 3377} \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {a^2 \cos (c+d x)}{d}+\frac {4 a b \cos (c+d x)}{d^3}+\frac {4 a b x \sin (c+d x)}{d^2}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {24 b^2 \cos (c+d x)}{d^5}-\frac {24 b^2 x \sin (c+d x)}{d^4}+\frac {12 b^2 x^2 \cos (c+d x)}{d^3}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2}-\frac {b^2 x^4 \cos (c+d x)}{d} \]
[In]
[Out]
Rule 2718
Rule 3377
Rule 3410
Rubi steps \begin{align*} \text {integral}& = \int \left (a^2 \sin (c+d x)+2 a b x^2 \sin (c+d x)+b^2 x^4 \sin (c+d x)\right ) \, dx \\ & = a^2 \int \sin (c+d x) \, dx+(2 a b) \int x^2 \sin (c+d x) \, dx+b^2 \int x^4 \sin (c+d x) \, dx \\ & = -\frac {a^2 \cos (c+d x)}{d}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {b^2 x^4 \cos (c+d x)}{d}+\frac {(4 a b) \int x \cos (c+d x) \, dx}{d}+\frac {\left (4 b^2\right ) \int x^3 \cos (c+d x) \, dx}{d} \\ & = -\frac {a^2 \cos (c+d x)}{d}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {b^2 x^4 \cos (c+d x)}{d}+\frac {4 a b x \sin (c+d x)}{d^2}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2}-\frac {(4 a b) \int \sin (c+d x) \, dx}{d^2}-\frac {\left (12 b^2\right ) \int x^2 \sin (c+d x) \, dx}{d^2} \\ & = \frac {4 a b \cos (c+d x)}{d^3}-\frac {a^2 \cos (c+d x)}{d}+\frac {12 b^2 x^2 \cos (c+d x)}{d^3}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {b^2 x^4 \cos (c+d x)}{d}+\frac {4 a b x \sin (c+d x)}{d^2}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2}-\frac {\left (24 b^2\right ) \int x \cos (c+d x) \, dx}{d^3} \\ & = \frac {4 a b \cos (c+d x)}{d^3}-\frac {a^2 \cos (c+d x)}{d}+\frac {12 b^2 x^2 \cos (c+d x)}{d^3}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {b^2 x^4 \cos (c+d x)}{d}-\frac {24 b^2 x \sin (c+d x)}{d^4}+\frac {4 a b x \sin (c+d x)}{d^2}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2}+\frac {\left (24 b^2\right ) \int \sin (c+d x) \, dx}{d^4} \\ & = -\frac {24 b^2 \cos (c+d x)}{d^5}+\frac {4 a b \cos (c+d x)}{d^3}-\frac {a^2 \cos (c+d x)}{d}+\frac {12 b^2 x^2 \cos (c+d x)}{d^3}-\frac {2 a b x^2 \cos (c+d x)}{d}-\frac {b^2 x^4 \cos (c+d x)}{d}-\frac {24 b^2 x \sin (c+d x)}{d^4}+\frac {4 a b x \sin (c+d x)}{d^2}+\frac {4 b^2 x^3 \sin (c+d x)}{d^2} \\ \end{align*}
Time = 0.12 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.62 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=\frac {-\left (\left (a^2 d^4+2 a b d^2 \left (-2+d^2 x^2\right )+b^2 \left (24-12 d^2 x^2+d^4 x^4\right )\right ) \cos (c+d x)\right )+4 b d x \left (a d^2+b \left (-6+d^2 x^2\right )\right ) \sin (c+d x)}{d^5} \]
[In]
[Out]
Time = 0.25 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.68
method | result | size |
risch | \(-\frac {\left (b^{2} x^{4} d^{4}+2 a b \,d^{4} x^{2}+a^{2} d^{4}-12 d^{2} x^{2} b^{2}-4 a b \,d^{2}+24 b^{2}\right ) \cos \left (d x +c \right )}{d^{5}}+\frac {4 b x \left (d^{2} x^{2} b +a \,d^{2}-6 b \right ) \sin \left (d x +c \right )}{d^{4}}\) | \(94\) |
parallelrisch | \(\frac {2 x^{2} d^{2} \left (\left (\frac {b \,x^{2}}{2}+a \right ) d^{2}-6 b \right ) b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \left (\left (b \,x^{2}+a \right ) d^{2}-6 b \right ) x d b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-b^{2} x^{4}-2 a b \,x^{2}-2 a^{2}\right ) d^{4}+\left (12 x^{2} b^{2}+8 a b \right ) d^{2}-48 b^{2}}{d^{5} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\) | \(133\) |
norman | \(\frac {\frac {b^{2} x^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a^{2} d^{4}-8 a b \,d^{2}+48 b^{2}}{d^{5}}-\frac {b^{2} x^{4}}{d}+\frac {8 b^{2} x^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{2}}-\frac {2 b \left (a \,d^{2}-6 b \right ) x^{2}}{d^{3}}+\frac {8 b \left (a \,d^{2}-6 b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d^{4}}+\frac {2 b \left (a \,d^{2}-6 b \right ) x^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d^{3}}}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\) | \(168\) |
parts | \(-\frac {b^{2} x^{4} \cos \left (d x +c \right )}{d}-\frac {2 a b \,x^{2} \cos \left (d x +c \right )}{d}-\frac {a^{2} \cos \left (d x +c \right )}{d}+\frac {4 b \left (-a c \sin \left (d x +c \right )+a \left (\cos \left (d x +c \right )+\left (d x +c \right ) \sin \left (d x +c \right )\right )-\frac {b \,c^{3} \sin \left (d x +c \right )}{d^{2}}+\frac {3 b \,c^{2} \left (\cos \left (d x +c \right )+\left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}-\frac {3 b c \left (\left (d x +c \right )^{2} \sin \left (d x +c \right )-2 \sin \left (d x +c \right )+2 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {b \left (\left (d x +c \right )^{3} \sin \left (d x +c \right )+3 \left (d x +c \right )^{2} \cos \left (d x +c \right )-6 \cos \left (d x +c \right )-6 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}\right )}{d^{3}}\) | \(229\) |
meijerg | \(\frac {16 b^{2} \sqrt {\pi }\, \sin \left (c \right ) \left (-\frac {x \left (d^{2}\right )^{\frac {5}{2}} \left (-\frac {5 d^{2} x^{2}}{2}+15\right ) \cos \left (d x \right )}{10 \sqrt {\pi }\, d^{4}}+\frac {\left (d^{2}\right )^{\frac {5}{2}} \left (\frac {5}{8} d^{4} x^{4}-\frac {15}{2} d^{2} x^{2}+15\right ) \sin \left (d x \right )}{10 \sqrt {\pi }\, d^{5}}\right )}{d^{4} \sqrt {d^{2}}}+\frac {16 b^{2} \sqrt {\pi }\, \cos \left (c \right ) \left (\frac {3}{2 \sqrt {\pi }}-\frac {\left (\frac {3}{8} d^{4} x^{4}-\frac {9}{2} d^{2} x^{2}+9\right ) \cos \left (d x \right )}{6 \sqrt {\pi }}-\frac {d x \left (-\frac {3 d^{2} x^{2}}{2}+9\right ) \sin \left (d x \right )}{6 \sqrt {\pi }}\right )}{d^{5}}+\frac {8 b a \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {x \left (d^{2}\right )^{\frac {3}{2}} \cos \left (d x \right )}{2 \sqrt {\pi }\, d^{2}}-\frac {\left (d^{2}\right )^{\frac {3}{2}} \left (-\frac {3 d^{2} x^{2}}{2}+3\right ) \sin \left (d x \right )}{6 \sqrt {\pi }\, d^{3}}\right )}{d^{2} \sqrt {d^{2}}}+\frac {8 b a \sqrt {\pi }\, \cos \left (c \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\left (-\frac {d^{2} x^{2}}{2}+1\right ) \cos \left (d x \right )}{2 \sqrt {\pi }}+\frac {d x \sin \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{3}}+\frac {a^{2} \sin \left (c \right ) \sin \left (d x \right )}{d}+\frac {a^{2} \sqrt {\pi }\, \cos \left (c \right ) \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (d x \right )}{\sqrt {\pi }}\right )}{d}\) | \(300\) |
derivativedivides | \(\frac {-a^{2} \cos \left (d x +c \right )-\frac {2 a b \,c^{2} \cos \left (d x +c \right )}{d^{2}}-\frac {4 a b c \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {2 a b \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}-\frac {b^{2} c^{4} \cos \left (d x +c \right )}{d^{4}}-\frac {4 b^{2} c^{3} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {6 b^{2} c^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}-\frac {4 b^{2} c \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {b^{2} \left (-\left (d x +c \right )^{4} \cos \left (d x +c \right )+4 \left (d x +c \right )^{3} \sin \left (d x +c \right )+12 \left (d x +c \right )^{2} \cos \left (d x +c \right )-24 \cos \left (d x +c \right )-24 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}}{d}\) | \(336\) |
default | \(\frac {-a^{2} \cos \left (d x +c \right )-\frac {2 a b \,c^{2} \cos \left (d x +c \right )}{d^{2}}-\frac {4 a b c \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {2 a b \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}-\frac {b^{2} c^{4} \cos \left (d x +c \right )}{d^{4}}-\frac {4 b^{2} c^{3} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {6 b^{2} c^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}-\frac {4 b^{2} c \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}+\frac {b^{2} \left (-\left (d x +c \right )^{4} \cos \left (d x +c \right )+4 \left (d x +c \right )^{3} \sin \left (d x +c \right )+12 \left (d x +c \right )^{2} \cos \left (d x +c \right )-24 \cos \left (d x +c \right )-24 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}}{d}\) | \(336\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.70 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {{\left (b^{2} d^{4} x^{4} + a^{2} d^{4} - 4 \, a b d^{2} + 2 \, {\left (a b d^{4} - 6 \, b^{2} d^{2}\right )} x^{2} + 24 \, b^{2}\right )} \cos \left (d x + c\right ) - 4 \, {\left (b^{2} d^{3} x^{3} + {\left (a b d^{3} - 6 \, b^{2} d\right )} x\right )} \sin \left (d x + c\right )}{d^{5}} \]
[In]
[Out]
Time = 0.33 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.25 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=\begin {cases} - \frac {a^{2} \cos {\left (c + d x \right )}}{d} - \frac {2 a b x^{2} \cos {\left (c + d x \right )}}{d} + \frac {4 a b x \sin {\left (c + d x \right )}}{d^{2}} + \frac {4 a b \cos {\left (c + d x \right )}}{d^{3}} - \frac {b^{2} x^{4} \cos {\left (c + d x \right )}}{d} + \frac {4 b^{2} x^{3} \sin {\left (c + d x \right )}}{d^{2}} + \frac {12 b^{2} x^{2} \cos {\left (c + d x \right )}}{d^{3}} - \frac {24 b^{2} x \sin {\left (c + d x \right )}}{d^{4}} - \frac {24 b^{2} \cos {\left (c + d x \right )}}{d^{5}} & \text {for}\: d \neq 0 \\\left (a^{2} x + \frac {2 a b x^{3}}{3} + \frac {b^{2} x^{5}}{5}\right ) \sin {\left (c \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 292 vs. \(2 (138) = 276\).
Time = 0.19 (sec) , antiderivative size = 292, normalized size of antiderivative = 2.12 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {a^{2} \cos \left (d x + c\right ) + \frac {b^{2} c^{4} \cos \left (d x + c\right )}{d^{4}} + \frac {2 \, a b c^{2} \cos \left (d x + c\right )}{d^{2}} - \frac {4 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b^{2} c^{3}}{d^{4}} - \frac {4 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a b c}{d^{2}} + \frac {6 \, {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} b^{2} c^{2}}{d^{4}} + \frac {2 \, {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} a b}{d^{2}} - \frac {4 \, {\left ({\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \cos \left (d x + c\right ) - 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \sin \left (d x + c\right )\right )} b^{2} c}{d^{4}} + \frac {{\left ({\left ({\left (d x + c\right )}^{4} - 12 \, {\left (d x + c\right )}^{2} + 24\right )} \cos \left (d x + c\right ) - 4 \, {\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \sin \left (d x + c\right )\right )} b^{2}}{d^{4}}}{d} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.72 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=-\frac {{\left (b^{2} d^{4} x^{4} + 2 \, a b d^{4} x^{2} + a^{2} d^{4} - 12 \, b^{2} d^{2} x^{2} - 4 \, a b d^{2} + 24 \, b^{2}\right )} \cos \left (d x + c\right )}{d^{5}} + \frac {4 \, {\left (b^{2} d^{3} x^{3} + a b d^{3} x - 6 \, b^{2} d x\right )} \sin \left (d x + c\right )}{d^{5}} \]
[In]
[Out]
Time = 6.26 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.86 \[ \int \left (a+b x^2\right )^2 \sin (c+d x) \, dx=\frac {4\,b^2\,x^3\,\sin \left (c+d\,x\right )}{d^2}-\frac {b^2\,x^4\,\cos \left (c+d\,x\right )}{d}-\frac {\cos \left (c+d\,x\right )\,\left (a^2\,d^4-4\,a\,b\,d^2+24\,b^2\right )}{d^5}-\frac {4\,x\,\sin \left (c+d\,x\right )\,\left (6\,b^2-a\,b\,d^2\right )}{d^4}+\frac {2\,x^2\,\cos \left (c+d\,x\right )\,\left (6\,b^2-a\,b\,d^2\right )}{d^3} \]
[In]
[Out]